/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.opentripplanner.nedimporter;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author demory
 */
public class ElevationProfile {

  private Map<Double, Double> elevations;

  public ElevationProfile() {
    elevations = new HashMap<Double, Double>();
  }

  public void addElevation(double x, double elev) {
    elevations.put(x, elev);
    System.out.println("   new elev pair: "+x+", "+elev);
  }

  public double minimum() {
    double result = Double.MAX_VALUE;
    for(double val : elevations.values())
      result = Math.min(val, result);
    return result;
  }

  public double maximum() {
    double result = Double.MIN_VALUE;
    for(double val : elevations.values())
      result = Math.max(val, result);
    return result;
  }


}
